<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    // 1.页面输出1-100
    let i = 1
    while (i <= 100) {
      document.write(i + '，')
      i++
    }
    // 2.计算从1到100之间所有数字的和
    let sum = 0
    let j = 1
    while (j <= 100) {
      sum += j
      j++
    }
    document.write('<br>'+'sum=' + sum)
    // 3.计算1-100之间所有偶数的和
    let sum2 = 0
    let k = 1
    while (k <= 100) {
      if (k % 2 === 0) {
        sum2 += k
      }
      k++
    }
    document.write('<br>'+'sum2=' + sum2)
    
  </script>
</body>
</html>